// zh_gjw/pages/shot/shot.js
var util = require('../../utils/util.js');
// var timePicker = require('../../utils/timePicker.js');
var ndates = new Date();
var ndate = ndates.getFullYear() + '-' + (ndates.getMonth() + 1) + '-' + ndates.getDate()
var ntime = ndates.getHours() + ':' + ndates.getMinutes() + ':' + ndates.getSeconds()
var starttime = ndates.getFullYear() + '-' + (ndates.getMonth() + 1) + '-' + (ndates.getDate()+1)
Page({

  /**
   * 页面的初始数据
   */
	data: {
		show0: false,
		showp0: true,
		show1: false,
		showp1: true,
		show2: false,
		showp2: true,
		show:0,
    upload_img: [],
		uploadimg: [],
		shotcate0: [],
		shotcate1: [],
		shotcate2: [],
		shotcateindex0: 0,
		shotcateindex1: 0,
		shotcateindex2: 0,
		arrayss: [['无脊柱动物', '脊柱动物'], ['扁性动物', '线形动物', '环节动物', '软体动物', '节肢动物'], ['猪肉绦虫', '吸血虫']],
		objectArrayss: [
			[
				{
					id: 0,
					name: '无脊柱动物'
				},
				{
					id: 1,
					name: '脊柱动物'
				}
			], [
				{
					id: 0,
					name: '扁性动物'
				},
				{
					id: 1,
					name: '线形动物'
				},
				{
					id: 2,
					name: '环节动物'
				},
				{
					id: 3,
					name: '软体动物'
				},
				{
					id: 3,
					name: '节肢动物'
				}
			], [
				{
					id: 0,
					name: '猪肉绦虫'
				},
				{
					id: 1,
					name: '吸血虫'
				}
			]
		],
		indexss: [0, 0, 0], 
		upshotu: [
			{ name: '1', value: '推荐' },
			{ name: '0', value: '不推荐', checked: 'true' },
		],
		upshott: [
			{ name: '1', value: '置顶' },
			{ name: '0', value: '不置顶', checked: 'true' },
		],
		times: ntime,
		time: ntime,
		ntime: ntime,
  },

  /**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    var that = this
		var starttime = util.formatTime(new Date).substring(0, 10).replace(/\//g, "-");

		getApp().util.request({
			url: 'entry/wxapp/Recostis',
			data: { openid: wx.getStorageSync('openid') },
			success: function (res) {
				if (res.data.code == 200) {
					that.setData({
						total: res.data.total
					})
				}
			}
		})
		getApp().util.request({
			url: 'entry/wxapp/Repucostshotf',
			data: { openid: wx.getStorageSync('openid') },
			success: function (res) {
				if (res.data.code == 200) {
					that.setData({
						rest: res.data.rest,
						restup: res.data.restup
					})
				}
			}
		})
		that.setData({
			admin:options.admin,
			dates: starttime,
			date: starttime,
			starttime: starttime,
		})
		getApp().util.request({
			'url': 'entry/wxapp/catestop',
			'cachetime': '0',
			success: function (res) {
				
				var result = []
				var resultid = []
				for (var i = 0; i < res.data.res.length; i++) {
					result.push(res.data.res[i].cate)
					resultid.push(res.data.res[i].id)
				}
				
				
				that.setData({
					shotcate0: result,
					shotcateid0: resultid,
				})
			}
		});
		getApp().util.request({
			'url': 'entry/wxapp/shotmoney',
			'cachetime': '0',
			success: function (res) {
				
				that.setData({
					publishfee: res.data.res.publishfee,
					upfee: res.data.res.upfee,
					topfee: res.data.res.topfee,
          shotbzj: res.data.res.bzj,
				})
			}
		})
		getApp().util.request({
			'url': 'entry/wxapp/Shset',
			'cachetime': '0',
			success: function (res) {
				
				that.setData({
					shotshset:res.data.res.shotshset
				})
			}
		})
  },

  /**
   * 生命周期函数--监听页面初次渲染完成
   */
  onReady: function () {
  
  },

  /**
   * 生命周期函数--监听页面显示
   */
  onShow: function () {
  
  },

  /**
   * 生命周期函数--监听页面隐藏
   */
  onHide: function () {
  
  },

  /**
   * 生命周期函数--监听页面卸载
   */
  onUnload: function () {
  
  },

  /**
   * 页面相关事件处理函数--监听用户下拉动作
   */
  onPullDownRefresh: function () {
  
  },

  /**
   * 页面上拉触底事件的处理函数
   */
  onReachBottom: function () {
  
  },

  /**
   * 用户点击右上角分享
   */
  onShareAppMessage: function () {
  
  },
  // radioChangep: function (e) {
  //   
	// },
	radioChangeu: function (e) {
		
		this.setData({
			upstate: e.detail.value
		})
	},
	radioChanget: function (e) {
		
		this.setData({
			topstate: e.detail.value
		})
	},
	bindPickerChange0: function (e) {
		
		var that = this
		this.setData({
			shotcateindex0: e.detail.value,
			show0: true,
			showp0: false
			// noneo: 0
		})
		getApp().util.request({
			'url': 'entry/wxapp/Catessub',
			'cachetime': '0',
			data: { pid: that.data.shotcateid0[e.detail.value] },
			success: function (res) {
				
				var result = []
				var resultid = []
				for (var i = 0; i < res.data.res.length; i++) {
					result.push(res.data.res[i].cate)
					resultid.push(res.data.res[i].id)
				}
				
				
				that.setData({
					shotcate1: result,
					shotcateid1: resultid,
					show1: true,
					showp1: false
				})
				getApp().util.request({
					'url': 'entry/wxapp/Catessub',
					'cachetime': '0',
					data: { pid: resultid[0] },
					success: function (ress) {
						if (ress.data.code == 200) {
							var results = []
							var resultids = []
							for (var j = 0; j < ress.data.res.length; j++) {
								results.push(ress.data.res[j].cate)
								resultids.push(ress.data.res[j].id)
							}
							that.setData({
								shotcate2: results,
								shotcateid2: resultids,
								show2: true,
								showp2: false
							})
						} else {
							that.setData({
								shotcate2: [],
								shotcateid2: [],
								show2: true,
								showp2: false
							})
						}
					}
				});
			}
		});
	},
	bindPickerChange1: function (e) {
		
		var that = this
		this.setData({
			shotcateindex1: e.detail.value,
			show1: true,
			showp1: false
			// nonet: 0
		})
		getApp().util.request({
			'url': 'entry/wxapp/Catessub',
			'cachetime': '0',
			data: { pid: that.data.shotcateid1[e.detail.value] },
			success: function (res) {
				
				var result = []
				var resultid = []
				for (var i = 0; i < res.data.res.length; i++) {
					result.push(res.data.res[i].cate)
					resultid.push(res.data.res[i].id)
				}
				
				
				that.setData({
					shotcate2: result,
					shotcateid2: resultid,
				})
			}
		});
	},
	bindPickerChange2: function (e) {
		
		this.setData({
			shotcateindex2: e.detail.value,
			show2: true,
			showp2: false
		})
	},
	bindPickerChangess: function (e) {
		var that = this
		
		this.setData({
			indexss: e.detail.value,
			show0: true,
			showp0: false
		})
	},
  bindDateChanges: function (e) {
		var that=this
    
    this.setData({
      dates: e.detail.value
    })
		if (e.detail.value == that.data.starttime){
			that.setData({
				times: that.data.ntime
			})
		}
  },
  bindTimeChanges: function (e) {
    
    this.setData({
      times: e.detail.value
    })
	},
	bindDateChange: function (e) {
		
		this.setData({
			date: e.detail.value
		})
	},
	bindTimeChange: function (e) {
		
		this.setData({
			time: e.detail.value
		})
	},
	upvideo: function () {
		var that = this
		// that.setData({
		// 	show:1
		// })
		wx.chooseVideo({
			sourceType: ['album', 'camera'],
			maxDuration: 15,
			camera: ['front', 'back'],
			success: function (res) {
				
        if(res.duration < 15){
					that.setData({
						show: 1,
						videosrc: res.tempFilePath,
						videotime: res.duration,
					})
				}else{
					wx.showToast({
						title: '视频超过15秒了',
						icon: 'none',
						duration: 3000
					})
				}
				
			},
			fail: function (res) {
				
			},
			complete: function (res) {
				
			}
		})
	},
	chooseImage3: function () {
		var that = this
		var upload_img = this.data.upload_img
		var img_length = 9 - upload_img.length
		if (img_length > 0 && img_length <= 9) {
			// 选择图片
			wx.chooseImage({
				count: img_length,
				sizeType: ['compressed'],
				sourceType: ['album', 'camera'], // 可以指定来源是相册还是相机，默认二者都有
				success: function (res) {
					wx.showToast({
						icon: "loading",
						title: "正在上传",
						duration: 3000
					})
					// 返回选定照片的本地文件路径列表，tempFilePath可以作为img标签的src属性显示图片
					var tempFilePaths = res.tempFilePaths;
					upload_img = upload_img.concat(tempFilePaths)
					
					that.setData({
						upload_img: upload_img,
					});
				}
			})
		}
	},
	already: function (data) {
		var that = this,
		i = data.i ? data.i : 0
		wx.uploadFile({
			url: data.url,
			filePath: data.path[i],
			name: 'upload_file',
			formData: null,
			success: (resp) => {
				var imgtemp = resp.data.replace('["', "")
				imgtemp = imgtemp.replace('"]', "")
				that.data.uploadimg.push(imgtemp)
			},
			complete: (res) => {
				i++;
				if (i == data.path.length) {
					that.submit()
				} else {
					data.i = i;
					that.already(data);
				}
			}
		});
	},
	delete: function (e) {
		
		var that = this
		var index = e.currentTarget.dataset.index
		
		that.data.upload_img.splice(index, 1);
		
		that.setData({
			upload_img: that.data.upload_img
		});
		that.uniques(that.data.uploadimg)
		
		that.data.uploadimg.splice(index, 1);
		
	},
	uniques: function (arr) {
		var len = arr.length;
		var result = []
		for (var i = 0; i < len; i++) {
			var flag = true;
			for (var j = i; j < arr.length - 1; j++) {
				if (arr[i] == arr[j + 1]) {
					flag = false;
					break;
				}
			}
			if (flag) {
				result.push(arr[i])
			}
		}
		this.data.uploadimg = result
	},
	formSubmit: function (e) {
		var that = this
		var formid = e.detail.formId;
		var fromtime = that.data.dates + ' ' + that.data.times;
		var totime = that.data.date + ' ' + that.data.time;
		// var bzj=e.detail.value.shotmoney*0.1
		// console.log(bzj)
		// if (that.data.date <= that.data.dates && that.data.time.slice(0, 5) <= that.data.times.slice(0, 5)) {
		// 		wx.showToast({
		// 			title: '起始时间与截止时间不正常哟',
		// 			icon: 'none',
		// 			duration: 3000
		// 		})
		// }else
		 if (e.detail.value.title == '') {
			wx.showToast({
				title: '标题不能为空',
				icon: 'none',
				duration: 3000
			})
		}
		//  else if (e.detail.value.shotmoney < 1) {
		// 	wx.showToast({
		// 		title: '起拍价不能小于1',
		// 		icon: 'none',
		// 		duration: 3000
		// 	})
		// } 
		else if (e.detail.value.exfee == '') {
			wx.showToast({
				title: '快递/物流费不能为空',
				icon: 'none',
				duration: 3000
			})
		} else if (that.data.upload_img.length < 1 && that.data.videosrc == undefined) {
			wx.showToast({
				title: '请至少上传一张图片或视频',
				icon: 'none',
				duration: 3000
			})
		 } else if (that.data.shotcateid2 == undefined) {
			 wx.showToast({
				 title: '好像还没有选择三级分类',
				 icon: 'none',
				 duration: 3000
			 })
		 }else{
			that.setData({
				tmdformid:formid,
				tmdtitle: e.detail.value.title,
				tmdshotmoney: e.detail.value.shotmoney,
				tmdbzj: that.data.shotbzj,
				// tmdckmoney: e.detail.value.ckmoney,
				tmdaddmoney: e.detail.value.addmoney,
				tmduserbzj: e.detail.value.userbzj,
				tmdexfee: e.detail.value.exfee,
				tmddetail: e.detail.value.textarea,
				tmdco_id: that.data.shotcateid0[that.data.shotcateindex0],
				tmdct_id: that.data.shotcateid1[that.data.shotcateindex1],
				tmdcth_id: that.data.shotcateid2[that.data.shotcateindex2],
				tmdtotime: totime, 
				tmdfromtime: fromtime,
				tmdadmin: that.data.admin,
				// tmdimg: imgstr, 
				// tmdvideoimgtemp: that.data.videoimgtemp
			})
			wx.showLoading({
				title: '正在上传',
			})
			if (that.data.videosrc != undefined && that.data.upload_img.length<1){
				wx.uploadFile({
					url: wx.getStorageSync('siteUrl') + 'app/index.php?i=' + wx.getStorageSync('uniacid') + '&c=entry&a=wxapp&do=Uploadvideo&m=zh_gjw',
					filePath: that.data.videosrc,
					name: 'upload_file',
					formData: null,
					success: function (res) {
						
						
						var videoimgtemp = res.data.replace('["', "")
						videoimgtemp = videoimgtemp.replace('"]', "")
						
						that.setData({
							videoimgtemp: videoimgtemp
						})
						that.submit()
					}
				})
			}
			if (that.data.upload_img.length >= 1 && that.data.videosrc == undefined){
				that.already({
					url: wx.getStorageSync('siteUrl') + 'app/index.php?i=' + wx.getStorageSync('uniacid') + '&c=entry&a=wxapp&do=Uploads&m=zh_gjw',
					path: that.data.upload_img
				})
			}
			if (that.data.upload_img.length >= 1 && that.data.videosrc != undefined){
				wx.uploadFile({
					url: wx.getStorageSync('siteUrl') + 'app/index.php?i=' + wx.getStorageSync('uniacid') + '&c=entry&a=wxapp&do=Uploadvideo&m=zh_gjw',
					filePath: that.data.videosrc,
					name: 'upload_file',
					formData: null,
					success: function (res) {
						
						
						var videoimgtemp = res.data.replace('["', "")
						videoimgtemp = videoimgtemp.replace('"]', "")
						
						that.setData({
							videoimgtemp: videoimgtemp
						})
						that.already({
							url: wx.getStorageSync('siteUrl') + 'app/index.php?i=' + wx.getStorageSync('uniacid') + '&c=entry&a=wxapp&do=Uploads&m=zh_gjw',
							path: that.data.upload_img
						});
					}
				})
			}
			
		}
	},
	//发布方式（保证金、商家用户、信誉、发布费、推荐）：1、01000；2、11000；3、01001；4、11001；5、01010；6、11010；7、01011；8、11011；9、01(00)00；10、11(00)00；11、01(00)01；12、11(00)01；13、01(00)10；14、11(00)10；15、01(00)11；16、11(00)11；17、01(01)00；18、11(01)00；19、01(01)01；20、11(01)01；21、01(01)10；22、11(01)10；23、01(01)11；24、11(01)11；25、01(10)00；26、11(10)00；27、01(10)01；28、11(10)01；29、01(10)10；30、11(10)10；31、01(10)11；32、11(10)11；33、01(11)00；34、11(11)00；35、01(11)01；36、11(11)01；37、01(11)10；38、11(11)10；39、01(11)11；40、11(11)11；
	submit:function(e){
		var that = this
		that.uniques(that.data.uploadimg)
		var imgstr = that.data.uploadimg.toString()
		getApp().util.request({
			'url': 'entry/wxapp/Shotpublish',
			'cachetime': '0',
			data: {
				formid: that.data.tmdformid,
				title: that.data.tmdtitle,
				shotmoney: that.data.tmdshotmoney,
				bzj: that.data.tmdbzj,
				// ckmoney: that.data.tmdckmoney,
				addmoney: that.data.tmdaddmoney,
				userbzj: that.data.tmduserbzj,
				exfee: that.data.tmdexfee,
				detail: that.data.tmddetail,
				co_id: that.data.tmdco_id,
				ct_id: that.data.tmdct_id,
				cth_id: that.data.tmdcth_id,
				c_id: that.data.tmdc_id,
				totime: that.data.tmdtotime,
				fromtime: that.data.tmdfromtime,
				admin: that.data.tmdadmin,
				img: imgstr,
				videoimgtemp: that.data.videoimgtemp
			},
			success: function (res) {
				if (res.data.code == 200){
					if (that.data.total > 0){
						if (that.data.upstate != 1 && that.data.rest == 0 && that.data.restup == 0){
							if (that.data.publishfee > 0) {//13、14
								if (that.data.tmdbzj > 0) {//11(00)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 14
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(00)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 13
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							}else{//9、10
								if (that.data.tmdbzj > 0) {//11(00)00
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 10
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(00)00
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 9
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate == 1 && that.data.rest == 0 && that.data.restup == 0){
							if(that.data.publishfee>0){//15、16
								if (that.data.tmdbzj>0) {//11(00)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 16
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(00)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 15
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							}else{//11、12
								if (that.data.tmdbzj > 0) {//11(00)01
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 12
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(00)01
									if(that.data.upfee>0){
										getApp().util.request({
											'url': 'entry/wxapp/Shotpay',
											'cachetime': '0',
											data: {
												openid: wx.getStorageSync('openid'),
												bzj: that.data.tmdbzj,
												publishfee: that.data.publishfee,
												upfee: that.data.upfee,
												upstate: that.data.upstate,
												res_id: res.data.res_id
											},
											success: function (sres) {
												wx.requestPayment({
													'timeStamp': sres.data.timeStamp,
													'nonceStr': sres.data.nonceStr,
													'package': sres.data.package,
													'signType': 'MD5',
													'paySign': sres.data.paySign,
													'success': function (pres) {
														getApp().util.request({
															url: 'entry/wxapp/Shotsuccess',
															data: {
																openid: wx.getStorageSync('openid'),
																res_id: res.data.res_id,
																upstate: that.data.upstate,
																alltype: 11
															},
															success: function (stres) {

																if (stres.data.code == 200) {
																	wx.showToast({
																		title: '发布成功,等待审核...',
																		icon: 'none',
																		duration: 3000
																	})
																	setTimeout(function () {
																		wx.navigateBack({
																		})
																	}, 1000)
																}
															}
														})
													},
													'fail': function (pres) {
														;
														wx.showToast({
															title: '支付失败',
															icon: "loading",
															duration: 1000
														})
													}
												})
											}
										})
									}else{
										getApp().util.request({
											url: 'entry/wxapp/Shotsuccess',
											data: {
												openid: wx.getStorageSync('openid'),
												res_id: res.data.res_id,
												upstate: that.data.upstate,
												alltype: 11
											},
											success: function (stres) {
												if (stres.data.code == 200) {
													wx.showToast({
														title: '发布成功,等待审核...',
														icon: 'none',
														duration: 3000
													})
													setTimeout(function () {
														wx.navigateBack({
														})
													}, 1000)
												}
											}
										})
									}
								}
							}
						} else if (that.data.upstate != 1 && that.data.rest == 0 && that.data.restup > 0){
							if(that.data.publishfee>0){//21、22
								if (that.data.tmdbzj > 0) {//11(01)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 22
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(01)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 21
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							}else{//17、18
								if (that.data.tmdbzj > 0) {//11(01)00
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 18
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(01)00
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 17
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate == 1 && that.data.rest == 0 && that.data.restup > 0){
							if(that.data.publishfee>0){//23、24
								if (that.data.tmdbzj > 0) {//11(01)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 24
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 24
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(01)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 23
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 23
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							} else {//19、20
								if (that.data.tmdbzj > 0) {//11(01)01
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 20
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 20
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(01)01
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 19
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate != 1 && that.data.rest > 0 && that.data.restup == 0){
							if (that.data.publishfee > 0){//29、30
								if (that.data.tmdbzj > 0) {//11(10)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 30
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 30
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(10)10
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 29
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}else{//25、26
								if (that.data.tmdbzj > 0) {//11(10)00
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 26
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(10)00
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 25
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate == 1 && that.data.rest > 0 && that.data.restup == 0) {
							if (that.data.publishfee > 0) {//31、32
								if (that.data.tmdbzj > 0) {//11(10)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 32
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 32
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(10)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 31
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 31
														},
														success: function (stres) {
															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							} else {//27、28
								if (that.data.tmdbzj > 0) {//11(10)01
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 28
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(10)01
									if(that.data.upfee>0){
										getApp().util.request({
											'url': 'entry/wxapp/Shotpay',
											'cachetime': '0',
											data: {
												openid: wx.getStorageSync('openid'),
												bzj: that.data.tmdbzj,
												publishfee: that.data.publishfee,
												upfee: that.data.upfee,
												upstate: that.data.upstate,
												res_id: res.data.res_id
											},
											success: function (sres) {
												wx.requestPayment({
													'timeStamp': sres.data.timeStamp,
													'nonceStr': sres.data.nonceStr,
													'package': sres.data.package,
													'signType': 'MD5',
													'paySign': sres.data.paySign,
													'success': function (pres) {
														getApp().util.request({
															url: 'entry/wxapp/Shotsuccess',
															data: {
																openid: wx.getStorageSync('openid'),
																res_id: res.data.res_id,
																upstate: that.data.upstate,
																alltype: 27
															},
															success: function (stres) {

																if (stres.data.code == 200) {
																	wx.showToast({
																		title: '发布成功,等待审核...',
																		icon: 'none',
																		duration: 3000
																	})
																	setTimeout(function () {
																		wx.navigateBack({
																		})
																	}, 1000)
																}
															}
														})
													},
													'fail': function (pres) {
														;
														wx.showToast({
															title: '支付失败',
															icon: "loading",
															duration: 1000
														})
													}
												})
											}
										})
									}else{
										getApp().util.request({
											url: 'entry/wxapp/Shotsuccess',
											data: {
												openid: wx.getStorageSync('openid'),
												res_id: res.data.res_id,
												upstate: that.data.upstate,
												alltype: 27
											},
											success: function (stres) {

												if (stres.data.code == 200) {
													wx.showToast({
														title: '发布成功,等待审核...',
														icon: 'none',
														duration: 3000
													})
													setTimeout(function () {
														wx.navigateBack({
														})
													}, 1000)
												}
											}
										})
									}
								}
							}
						} else if (that.data.upstate != 1 && that.data.rest > 0 && that.data.restup > 0) {
							if (that.data.publishfee > 0) {//37、38
								if (that.data.tmdbzj > 0) {//11(11)10
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 38
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 38
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(11)10
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 37
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							} else {//33、34
								if (that.data.tmdbzj > 0) {//11(11)00
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 34
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(11)00
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 33
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate == 1 && that.data.rest > 0 && that.data.restup > 0) {
							if (that.data.publishfee > 0) {//39、40
								if (that.data.tmdbzj > 0) {//11(11)11
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 40
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 40
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(11)11
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 39
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							} else {//35、36
								if (that.data.tmdbzj > 0) {//11(11)01
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id,
											alltype: 36
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 36
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01(11)01
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype: 35
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						}
					}else{
						if (that.data.upstate != 1) {
							if (that.data.publishfee > 0) {//5、6
								if (that.data.tmdbzj > 0){//11010
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 6
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01010
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 5
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							} else {//1、2
								if (that.data.tmdbzj > 0) {//11000
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 2
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01000
									getApp().util.request({
										url: 'entry/wxapp/Shotsuccess',
										data: {
											openid: wx.getStorageSync('openid'),
											res_id: res.data.res_id,
											upstate: that.data.upstate,
											alltype:1
										},
										success: function (stres) {
											if (stres.data.code == 200) {
												wx.showToast({
													title: '发布成功,等待审核...',
													icon: 'none',
													duration: 3000
												})
												setTimeout(function () {
													wx.navigateBack({
													})
												}, 1000)
											}
										}
									})
								}
							}
						} else if (that.data.upstate == 1){
							if (that.data.publishfee > 0){//7、8
								if (that.data.tmdbzj > 0) {//11011
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 8
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01011
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 7
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								}
							}else{//3、4
								if (that.data.tmdbzj > 0){//11001
									getApp().util.request({
										'url': 'entry/wxapp/Shotpay',
										'cachetime': '0',
										data: {
											openid: wx.getStorageSync('openid'),
											bzj: that.data.tmdbzj,
											publishfee: that.data.publishfee,
											upfee: that.data.upfee,
											upstate: that.data.upstate,
											res_id: res.data.res_id
										},
										success: function (sres) {
											wx.requestPayment({
												'timeStamp': sres.data.timeStamp,
												'nonceStr': sres.data.nonceStr,
												'package': sres.data.package,
												'signType': 'MD5',
												'paySign': sres.data.paySign,
												'success': function (pres) {
													getApp().util.request({
														url: 'entry/wxapp/Shotsuccess',
														data: {
															openid: wx.getStorageSync('openid'),
															res_id: res.data.res_id,
															upstate: that.data.upstate,
															alltype: 4
														},
														success: function (stres) {

															if (stres.data.code == 200) {
																wx.showToast({
																	title: '发布成功,等待审核...',
																	icon: 'none',
																	duration: 3000
																})
																setTimeout(function () {
																	wx.navigateBack({
																	})
																}, 1000)
															}
														}
													})
												},
												'fail': function (pres) {
													;
													wx.showToast({
														title: '支付失败',
														icon: "loading",
														duration: 1000
													})
												}
											})
										}
									})
								} else {//01001
									if(that.data.upfee>0){
										getApp().util.request({
											'url': 'entry/wxapp/Shotpay',
											'cachetime': '0',
											data: {
												openid: wx.getStorageSync('openid'),
												bzj: that.data.tmdbzj,
												publishfee: that.data.publishfee,
												upfee: that.data.upfee,
												upstate: that.data.upstate,
												res_id: res.data.res_id
											},
											success: function (sres) {
												wx.requestPayment({
													'timeStamp': sres.data.timeStamp,
													'nonceStr': sres.data.nonceStr,
													'package': sres.data.package,
													'signType': 'MD5',
													'paySign': sres.data.paySign,
													'success': function (pres) {
														getApp().util.request({
															url: 'entry/wxapp/Shotsuccess',
															data: {
																openid: wx.getStorageSync('openid'),
																res_id: res.data.res_id,
																upstate: that.data.upstate,
																alltype: 3
															},
															success: function (stres) {

																if (stres.data.code == 200) {
																	wx.showToast({
																		title: '发布成功,等待审核...',
																		icon: 'none',
																		duration: 3000
																	})
																	setTimeout(function () {
																		wx.navigateBack({
																		})
																	}, 1000)
																}
															}
														})
													},
													'fail': function (pres) {
														;
														wx.showToast({
															title: '支付失败',
															icon: "loading",
															duration: 1000
														})
													}
												})
											}
										})
									}else{
										getApp().util.request({
											url: 'entry/wxapp/Shotsuccess',
											data: {
												openid: wx.getStorageSync('openid'),
												res_id: res.data.res_id,
												upstate: that.data.upstate,
												alltype: 3
											},
											success: function (stres) {

												if (stres.data.code == 200) {
													wx.showToast({
														title: '发布成功,等待审核...',
														icon: 'none',
														duration: 3000
													})
													setTimeout(function () {
														wx.navigateBack({
														})
													}, 1000)
												}
											}
										})
									}
								}
							}
						}
					}
				}else{
					wx.showToast({
						title: '发布出错',
						duration:3000
					})
				}
			}
		})
	}
})